LIBS= -lgdsl
VPATH=../
Tsyntax_tree=Tsyntax_tree
Tsyntax_tree_dep=syntax_tree.o Tsyntax_tree.o
Tsymbol_table=Tsymbol_table
Tsymbol_table_dep=symbol_table.o Tsymbol_table.o
Tinterpreter=Tinterpreter
Tinterpreter_dep=interpreter.o Tinterpreter.o syntax_tree.o symbol_table.o
TAG= $(Tsyntax_tree) $(Tsymbol_table) $(Tinterpreter)

all: $(TAG)


$(Tsyntax_tree) : $(Tsyntax_tree_dep)
	gcc -o $@ $^ $(LIBS)

$(Tsymbol_table) : $(Tsymbol_table_dep)
	gcc -o $@ $^ $(LIBS)
$(Tinterpreter) : $(Tinterpreter_dep) ../tiny_y.h
	gcc -o $@ $^ $(LIBS)

interpreter.o: ../tiny_y.h

%.o : %.c
	gcc -c $<

%_y.h: %.y
	yacc -o $@ -d $<

clean:
	rm -f $(TAG) $(Tsyntax_tree_dep) $(Tsymbol_table_dep) $(Tinterpreter_dep) *~
